﻿@model System.Collections.Specialized.OrderedDictionary

@{
    ViewBag.Title = "Edit Data Table";
 }

<h2>@ViewBag.TableName</h2>

<p>
    @Html.ActionLink("Create New", "Create", new { id = ViewBag.TableMasterID })
</p>

      <table>
            <tr>
                @foreach (string key in (Model[0] as System.Collections.Specialized.OrderedDictionary).Keys)
                {
                    <th>@key</th>
                }
                <th></th>
            </tr>

        @foreach (System.Collections.Specialized.OrderedDictionary item in Model.Values)
        {
            <tr>
                @foreach(string value in item.Values)
                {
                    <td>@value
                    </td>
                }
                <td>
                    @Html.ActionLink("Edit Data", "Edit", new { id = item["DataID"], tableMasterID = ViewBag.TableMasterID }) |
                    @Html.ActionLink("Delete Data", "Delete", new {id = item["DataID"], tableMasterID = ViewBag.TableMasterID })
                </td>
            </tr>
        }

        </table>

        @{Html.RenderAction("_ListDataTables", "DataTable");}


